package net.sesami.nhg.ebd.batch.properties;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;

public class ApplicationProperties {
	private Map<String, String> propertiesMap = new HashMap<String, String>();

	private void loadProperties() {
		ResourceBundle resourceBundle = ResourceBundle
				.getBundle("properties.application");
		try {
			Set<String> set = resourceBundle.keySet();
			Iterator<String> itr = set.iterator();
			while (itr.hasNext()) {
				String key = itr.next();
				propertiesMap.put(key, resourceBundle.getString(key));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public ApplicationProperties() {
		this.loadProperties();
	}

	public String getProperty(String key) {
		return this.propertiesMap.get(key);
	}
}
